﻿@model WalkingTec.Mvvm.Mvc.Admin.ViewModels.FrameworkGroupVMs.FrameworkGroupMDVM

<wt:form vm="@Model">
    @for (int i = 0; i < Model.DpLists.Count; i++)
    {
        <wt:hidden field="DpLists[i].List.Searcher.TableName" />
        <wt:combobox field="DpLists[i].IsAll" yes-text="全部权限" no-text="选择权限" empty-text="无权限" label-text="@Model.DpLists[i].DpName" change-func="IsAllChange@(i)" />
        <wt:row id="selector@(i)">
            <wt:selector list-vm="DpLists[i].List" field="DpLists[i].SelectedIds" text-bind="DpLists[i].List.EntityList[0].Name" label-text="">
            </wt:selector>
        </wt:row>

        <script>
            IsAllChange@(i)({ value: '@Model.DpLists[i].IsAll.ToString().ToLower()' });
            function IsAllChange@(i)(data) {
                if (data.value == 'true' || data.value == '') {
                    $('#selector@(i)').css('display', 'none');
                }
                else {
                    $('#selector@(i)').css('display', 'block');
                }
            }

        </script>
    }

    <wt:hidden field="GroupId" />
    <wt:row align="AlignEnum.Right">
        <wt:submitbutton />
        <wt:closebutton />
    </wt:row>
</wt:form>
